package com.wang.home.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @className: RegisterInterceptor
 * @description: 类描述
 * @author: tian
 * @date: 2021/4/17 10:39
 */
@Configuration
public class RegisterInterceptor implements WebMvcConfigurer {
//WebMvcConfigurer是SpringBoot新版本提供的  旧版本没有的

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new CorsInterceptor()).addPathPatterns("/**");

    }

}
